package com.example.footballsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import com.example.footballsystem.entity.News;

import java.sql.Timestamp;
import java.util.List;

@Mapper
public interface NewsMapper extends BaseMapper<News>{
    @Insert("insert into hotnews (imageLink, title, time, content, newID,createdate,navigation) value (#{imagelink},#{title},#{time},#{content},#{newID},#{createDate},#{navigation})")
    public Boolean addNew(News news);
    @Select("select * from hotnews")
    public List<News> getAllNews();
    @Select("select * from hotnews where content like #{info}")
    public List<News> searchByContent(String info);
    @Select("select * from hotnews where title like #{info}")
    public List<News> searchByTitle(String info);
    @Select("select * from hotnews where newID = #{info}")
    public List<News> searchByNewID(int info);
    @Delete("delete from hotnews where newID=#{newID}")
    public Boolean deleteNew(int newID);
}
